const App = getApp();
const api = require('../../utils/api.js');

Page({

  data: {
    title: '',
    options:null,
    info:{},
    pois:[],
    infoData: [
      {
        id:1,
        hottest_places:'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1605156437532&di=4eefb31768fe042e59af7dab4a83de94&imgtype=0&src=http%3A%2F%2Fimg1.qunarzz.com%2Ftravel%2Fd5%2F1807%2F43%2F82ec53a948f0c4b5.png',
        name_zh:'厦门',
        visited_count:200886,
        wish_to_count:2307998,
      },
      {
        id:2,
        hottest_places:'http://imgbdb3.bendibao.com/xmbdb/tour/20199/04/2019904142504_86305.jpg',
        name_zh:'成都',
        visited_count:30886,
        wish_to_count:456789,
      },
      {
        id:3,
        hottest_places:'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=3897884340,2051145891&fm=26&gp=0.jpg',
        name_zh:'西藏',
        visited_count:345232,
        wish_to_count:5567886,
      },
      {
        id:4,
        hottest_places:'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2780956316,2479416189&fm=26&gp=0.jpg',
        name_zh:'大理',
        visited_count:645232,
        wish_to_count:53367886,
      },
      {
        id:5,
        hottest_places:'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2742556342,3656851548&fm=26&gp=0.jpg',
        name_zh:'厦门',
        visited_count:645232,
        wish_to_count:53367886,
      },
      {
        id:6,
        hottest_places:'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1590969591,3077526434&fm=26&gp=0.jpg',
        name_zh:'北京',
        visited_count:766232,
        wish_to_count:57856783,
      },
      {
        id:7,
        hottest_places:'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=3165427354,3735827212&fm=26&gp=0.jpg',
        name_zh:'上海',
        visited_count:9675567,
        wish_to_count:686525789,
      },
      {
        id:8,
        hottest_places:'https://ns-strategy.cdn.bcebos.com/ns-strategy/upload/fc_big_pic/part-00667-4080.jpg',
        name_zh:'广州',
        visited_count:766232,
        wish_to_count:57856783,
      },
      {
        id:9,
        hottest_places:'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=2408788491,3989751730&fm=26&gp=0.jpg',
        name_zh:'武汉',
        visited_count:76532,
        wish_to_count:6863146,
      },
      {
        id:10,
        hottest_places:'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3033490706,2151377445&fm=26&gp=0.jpg',
        name_zh:'三亚',
        visited_count:856345,
        wish_to_count:4685621,
      },
      {
        id:11,
        hottest_places:'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2087492153,3445519584&fm=26&gp=0.jpg',
        name_zh:'成都',
        visited_count:757844,
        wish_to_count:17063466,
      },
      {
        id:12,
        hottest_places:'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2956702800,2184468274&fm=26&gp=0.jpg',
        name_zh:'大理',
        visited_count:766232,
        wish_to_count:57856783,
      },
      {
        id:13,
        hottest_places:'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=780650872,2542478372&fm=26&gp=0.jpg',
        name_zh:'拉萨',
        visited_count:15489,
        wish_to_count:367947,
      },
      {
        id:14,
        hottest_places:'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3866099762,1368781042&fm=26&gp=0.jpg',
        name_zh:'敦煌',
        visited_count:37936,
        wish_to_count:5647320,
      }
    ],
     poiData:[
       {
         id:1,
         pois:[
          {
            name:'鼓浪屿',
            rate:9.0,
            rating_count:767685,
            cover_s:'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1518786926,4007162700&fm=26&gp=0.jpg'
          },
          {
            name:'云水瑶',
            rate:9.5,
            rating_count:667685,
            cover_s:'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=3065023498,321197971&fm=26&gp=0.jpg'
          },
          {
            name:'厦门大学',
            rate:8.8,
            rating_count:345685,
            cover_s:'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=2181139609,3260455632&fm=26&gp=0.jpg'
          },
          {
            name:'曾厝垵',
            rate:8.4,
            rating_count:325633,
            cover_s:'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1150777324,1438297380&fm=26&gp=0.jpg'
          }
        ]
       },
       {
        id:2,
        pois:[

          {
            name:'龙潭水乡',
            rate:8.8,
            rating_count:346678,
            cover_s:'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1518786926,4007162700&fm=26&gp=0.jpg'
          },
          {
            name:'青城山',
            rate:8.0,
            rating_count:235775,
            cover_s:'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=389368035,1038100309&fm=26&gp=0.jpg'
          },
          {
            name:'乐山大佛',
            rate:8.5,
            rating_count:334674,
            cover_s:'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=1685095414,2220231388&fm=26&gp=0.jpg'
          },
          {
            name:'九寨沟',
            rate:8.9,
            rating_count:5657653,
            cover_s:'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=147922124,1194038234&fm=26&gp=0.jpg'
          }
       ]
      },
      {
        id:3,
        pois:[

          {
            name:'纳木错',
            rate:8.8,
            rating_count:346678,
            cover_s:'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2044698319,3999832936&fm=26&gp=0.jpg'
          },
          {
            name:'大昭寺',
            rate:8.0,
            rating_count:235775,
            cover_s:'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3658417481,1526731248&fm=26&gp=0.jpg'
          },
          {
            name:'布达拉宫',
            rate:8.5,
            rating_count:334674,
            cover_s:'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3226043810,996345175&fm=26&gp=0.jpg'
          },
          {
            name:'罗布林卡',
            rate:8.1,
            rating_count:5657653,
            cover_s:'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3619017488,2605108935&fm=26&gp=0.jpg'
          }
       ]
      },
      {
        id:4,
        pois:[

          {
            name:'石林风景区',
            rate:8.8,
            rating_count:346678,
            cover_s:'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1695742884,121621131&fm=26&gp=0.jpg'
          },
          {
            name:'洱海',
            rate:8.1,
            rating_count:235775,
            cover_s:'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2549911868,2076052569&fm=26&gp=0.jpg'
          },
          {
            name:'大理古城',
            rate:8.2,
            rating_count:445462,
            cover_s:'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=2942129860,1608002993&fm=26&gp=0.jpg'
          },
          {
            name:'玉龙雪山',
            rate:8.3,
            rating_count:5657653,
            cover_s:'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3166172875,3452654345&fm=26&gp=0.jpg'
          }
       ]
      },
      {
        id:5,
        pois:[
         {
           name:'鼓浪屿',
           rate:9.0,
           rating_count:767685,
           cover_s:'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1518786926,4007162700&fm=26&gp=0.jpg'
         },
         {
           name:'云水瑶',
           rate:9.5,
           rating_count:667685,
           cover_s:'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=3065023498,321197971&fm=26&gp=0.jpg'
         },
         {
           name:'厦门大学',
           rate:8.8,
           rating_count:345685,
           cover_s:'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=2181139609,3260455632&fm=26&gp=0.jpg'
         },
         {
           name:'曾厝垵',
           rate:8.4,
           rating_count:325633,
           cover_s:'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1150777324,1438297380&fm=26&gp=0.jpg'
         }
       ]
      },
      {
        id:6,
        pois:[
         {
           name:'长城',
           rate:9.0,
           rating_count:767685,
           cover_s:'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1139460308,808361535&fm=26&gp=0.jpg'
         },
         {
           name:'故宫',
           rate:9.5,
           rating_count:667685,
           cover_s:'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1141409116,3060116345&fm=26&gp=0.jpg'
         },
         {
           name:'前门大街',
           rate:8.8,
           rating_count:345685,
           cover_s:'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1857638102,1523580764&fm=26&gp=0.jpg'
         },
         {
           name:'天坛',
           rate:8.4,
           rating_count:325633,
           cover_s:'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=25344017,3462105168&fm=26&gp=0.jpg'
         }
       ]
      },
      {
        id:7,
        pois:[
         {
           name:'外滩',
           rate:9.0,
           rating_count:767685,
           cover_s:'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1968841078,679401240&fm=26&gp=0.jpg'
         },
         {
           name:'鲁迅公园',
           rate:9.5,
           rating_count:667685,
           cover_s:'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2789763368,3615795752&fm=26&gp=0.jpg'
         },
         {
           name:'上海美术馆',
           rate:8.8,
           rating_count:345685,
           cover_s:'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2047507004,4167006945&fm=26&gp=0.jpg'
         },
         {
           name:'上海老街',
           rate:8.4,
           rating_count:325633,
           cover_s:'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2789826703,2079029170&fm=26&gp=0.jpg'
         }
       ]
      },
      {
        id:8,
        pois:[
         {
           name:'长隆乐园',
           rate:9.0,
           rating_count:767685,
           cover_s:'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3321932550,3089604847&fm=26&gp=0.jpg'
         },
         {
           name:'巽寮湾',
           rate:9.5,
           rating_count:667685,
           cover_s:'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=2022086391,2482921757&fm=26&gp=0.jpg'
         },
         {
           name:'港珠澳大桥',
           rate:8.8,
           rating_count:345685,
           cover_s:'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=2719141501,1269750176&fm=26&gp=0.jpg'
         },
         {
           name:'小蛮腰',
           rate:8.4,
           rating_count:325633,
           cover_s:'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=3953009518,4116381737&fm=26&gp=0.jpg'
         }
       ]
      },
      {
        id:9,
        pois:[
         {
           name:'欢乐谷',
           rate:9.0,
           rating_count:767685,
           cover_s:'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=3546101299,1899099787&fm=26&gp=0.jpg'
         },
         {
           name:'东湖海洋世界',
           rate:9.5,
           rating_count:667685,
           cover_s:'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=342400572,1576957084&fm=26&gp=0.jpg'
         },
         {
           name:'磨山风景区',
           rate:8.8,
           rating_count:345685,
           cover_s:'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3867889687,3952507662&fm=26&gp=0.jpg'
         },
         {
           name:'武汉大学',
           rate:8.4,
           rating_count:325633,
           cover_s:'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=2112742367,3090523730&fm=26&gp=0.jpg'
         }
       ]
      },
      {
        id:10,
        pois:[
         {
           name:'蜈支洲岛',
           rate:9.0,
           rating_count:767685,
           cover_s:'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1631861502,187456092&fm=26&gp=0.jpg'
         },
         {
           name:'天涯海角',
           rate:9.5,
           rating_count:667685,
           cover_s:'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1757010892,346821828&fm=26&gp=0.jpg'
         },
         {
           name:'亚龙湾',
           rate:8.8,
           rating_count:345685,
           cover_s:'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1693193655,2593155073&fm=26&gp=0.jpg'
         },
         {
           name:'槟郎谷',
           rate:8.4,
           rating_count:325633,
           cover_s:'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=729755402,2204927593&fm=26&gp=0.jpg'
         }
       ]
      },
      {
        id:11,
        pois:[

          {
            name:'龙潭水乡',
            rate:8.8,
            rating_count:346678,
            cover_s:'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1518786926,4007162700&fm=26&gp=0.jpg'
          },
          {
            name:'青城山',
            rate:8.0,
            rating_count:235775,
            cover_s:'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=389368035,1038100309&fm=26&gp=0.jpg'
          },
          {
            name:'乐山大佛',
            rate:8.5,
            rating_count:334674,
            cover_s:'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=1685095414,2220231388&fm=26&gp=0.jpg'
          },
          {
            name:'九寨沟',
            rate:8.9,
            rating_count:5657653,
            cover_s:'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=147922124,1194038234&fm=26&gp=0.jpg'
          }
       ]
      },
      {
        id:13,
        pois:[

          {
            name:'纳木错',
            rate:8.8,
            rating_count:346678,
            cover_s:'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2044698319,3999832936&fm=26&gp=0.jpg'
          },
          {
            name:'大昭寺',
            rate:8.0,
            rating_count:235775,
            cover_s:'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3658417481,1526731248&fm=26&gp=0.jpg'
          },
          {
            name:'布达拉宫',
            rate:8.5,
            rating_count:334674,
            cover_s:'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3226043810,996345175&fm=26&gp=0.jpg'
          },
          {
            name:'罗布林卡',
            rate:8.1,
            rating_count:5657653,
            cover_s:'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3619017488,2605108935&fm=26&gp=0.jpg'
          }
       ]
      },
      {
        id:14,
        pois:[

          {
            name:'莫高窟',
            rate:8.8,
            rating_count:346678,
            cover_s:'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=2157977469,1641917245&fm=26&gp=0.jpg'
          },
          {
            name:'鸣沙山',
            rate:8.0,
            rating_count:235775,
            cover_s:'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2350395067,2879991281&fm=26&gp=0.jpg'
          },
          {
            name:'雅丹国家地质公园',
            rate:8.5,
            rating_count:334674,
            cover_s:'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=313785207,299251774&fm=26&gp=0.jpg'
          },
          {
            name:'玉门关',
            rate:8.1,
            rating_count:5657653,
            cover_s:'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3630650516,3853171251&fm=26&gp=0.jpg'
          }
       ]
      },
      {
        id:12,
        pois:[

          {
            name:'石林风景区',
            rate:8.8,
            rating_count:346678,
            cover_s:'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1695742884,121621131&fm=26&gp=0.jpg'
          },
          {
            name:'洱海',
            rate:8.0,
            rating_count:235775,
            cover_s:'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2549911868,2076052569&fm=26&gp=0.jpg'
          },
          {
            name:'大理古城',
            rate:8.2,
            rating_count:445462,
            cover_s:'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=2942129860,1608002993&fm=26&gp=0.jpg'
          },
          {
            name:'玉龙雪山',
            rate:8.1,
            rating_count:5657653,
            cover_s:'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3166172875,3452654345&fm=26&gp=0.jpg'
          }
       ]
      },
     ],

    windowWidth: App.systemInfo.windowWidth,
    windowHeight: App.systemInfo.windowHeight,
  },

  onLoad: function (options) {
    const id = options.id
    const name = options.name
    this.setData({
      title:name,
      id
    })
    const info = this.data.infoData
    const poi = this.data.poiData
    console.log()
    this.selectInfo(info)
    this.selectPOI(poi)
  },
  onReady(){
    wx.setNavigationBarTitle({
      title: this.data.title,
    })
  },
  selectInfo(arr){
    for (const item of arr) {
      if(item.id == this.data.id){
        this.setData({
          info:item
        })
      }
    }
  },
  selectPOI(arr){
    for (const item of arr) {
      if(item.id == this.data.id){
        this.setData({
          pois:item.pois
        })
      }
    }
  },
  viewPOIList(){
    wx.showToast({
      title: '暂无更多数据',
      duration:2000
    })
  }
})